<%
	name = "";
	line_1 = "";
	line_2 = "";
	line_3 = "";
	line_4 = "";
	postal_code = "";
	city = "";
	region_code = "";
	
	if(c_outlet != null) {
		name = c_outlet.getOutlet().getName();
		if(c_outlet.getOutlet().getAddress3().length() > 0) {
			JSONObject obj = (JSONObject) JSONValue.parse(c_outlet.getOutlet().getAddress3());

			line_1 = (obj.get("line_1") == null) ? "" : obj.get("line_1").toString().trim();
			line_2 = (obj.get("line_2") == null) ? "" : obj.get("line_2").toString().trim();
			line_3 = (obj.get("line_3") == null) ? "" : obj.get("line_3").toString().trim();
			line_4 = (obj.get("line_4") == null) ? "" : obj.get("line_4").toString().trim();
			postal_code = (obj.get("postal_code") == null) ? "" : obj.get("postal_code").toString().trim();
			city = (obj.get("city") == null) ? "" : obj.get("city").toString().trim();
			region_code = (obj.get("region_code") == null) ? "" : obj.get("region_code").toString().trim();
		}
	}
%>
<div class="row-fluid page">
	<div class="span12">

		<div class="section-header"><%= name %> - Correspondence Address</div>
		<div class="row-fluid outlet-main-content">
			<div class="span12">
				<div class="form-horizontal">
					<div class="row-fluid">
						<div class="span12">
							<div class="control-group">
								<label class="control-label">Line 1</label>
								<div class="controls">
									<input type="text" id="line_1" value="<%= line_1 %>" maxlength="30" />
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Line 2</label>
								<div class="controls">
									<input type="text" id="line_2" value="<%= line_2 %>" maxlength="30" />
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Line 3</label>
								<div class="controls">
									<input type="text" id="line_3" value="<%= line_3 %>" maxlength="30" />
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Line 4</label>
								<div class="controls">
									<input type="text" id="line_4" value="<%= line_4 %>" maxlength="30" />
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Postal Code</label>
								<div class="controls">
									<input type="text" id="postal_code" value="<%= postal_code %>" />
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">City</label>
								<div class="controls">
									<input type="text" id="city" value="<%= city %>" />
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">Region Code (3 digit)</label>
								<div class="controls">
									<select id="region_code">
										<option value=""></option>
										<%
											html = "<option value=\"002\">002 - Sabah</option>"
												+ "<option value=\"003\">003 - Sarawak</option>"
												+ "<option value=\"004\">004 - Perlis</option>"
												+ "<option value=\"005\">005 - Kedah</option>"
												+ "<option value=\"006\">006 - Pulau Pinang</option>"
												+ "<option value=\"007\">007 - Perak</option>"
												+ "<option value=\"008\">008 - Kelantan</option>"
												+ "<option value=\"009\">009 - Terengganu</option>"
												+ "<option value=\"010\">010 - Pahang</option>"
												+ "<option value=\"011\">011 - Selangor</option>"
												+ "<option value=\"012\">012 - Negeri Sembilan</option>"
												+ "<option value=\"013\">013 - Melaka</option>"
												+ "<option value=\"014\">014 - Johor</option>"
												+ "<option value=\"015\">015 - Wilayah Persekutuan</option>";
											
											html = html.replace("<option value=\"" + region_code + "\">", "<option value=\"" + region_code + "\" selected />");		
											out.println(html);
										%>
									</select>
									Applicable to Amex only
								</div>
							</div>
						</div>
					</div>
				</div>		
			</div>
			
		</div>
		
	</div>
</div>